package cn.gcBlock.po;


import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.SerializerFeature;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.Serializable;

@Data
@Entity(name = "block_node")
public class Node extends NodeEntity implements Serializable, Cloneable {
    @Id
    @Column(length = 128)
    String signature;  //数字签名，认证;主键
    //携带数据
    @JSONField(serialzeFeatures= {SerializerFeature.WriteMapNullValue, SerializerFeature.WriteNullStringAsEmpty},ordinal = 9)
    @Column(columnDefinition = "longtext")
    String dataBlock;
    @Override
    public Node clone() throws CloneNotSupportedException {
        Node stu = (Node) super.clone();   //浅复制
        return stu;
    }
}
